<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <th:block th:replace="~{/_include/header}" />
    <meta name="page-help" content="https://getrebuild.com/docs/admin/entity/#%E5%AD%97%E6%AE%B5%E7%AE%A1%E7%90%86" />
    <title>[[${bundle.L('字段管理')}]]</title>
  </head>
  <body>
    <div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo rb-aside rb-color-header" th:classappend="${sideCollapsedClazz}">
      <th:block th:replace="~{/_include/nav-top}" />
      <th:block th:replace="~{/_include/nav-left-admin(active='entities')}" />
      <div class="rb-content">
        <aside class="page-aside">
          <div class="rb-scroller-aside rb-scroller">
            <div class="aside-content">
              <div class="content">
                <div class="aside-header">
                  <button class="navbar-toggle collapsed" type="button"><span class="icon zmdi zmdi-caret-down"></span></button>
                  <span class="title">[[${entityLabel}]]</span>
                  <p class="description">[[${comments}]]</p>
                </div>
              </div>
              <div class="aside-nav collapse">
                <ul class="nav">
                  <li><a href="base">[[${bundle.L('基本信息')}]]</a></li>
                  <li><a href="form-design">[[${bundle.L('表单设计')}]]</a></li>
                  <li class="active"><a href="fields">[[${bundle.L('字段管理')}]]</a></li>
                  <li><a href="advanced">[[${bundle.L('高级配置')}]]</a></li>
                </ul>
              </div>
            </div>
          </div>
        </aside>
        <div class="main-content container-fluid">
          <div class="card card-table">
            <div class="card-body">
              <div class="dataTables_wrapper container-fluid">
                <div class="row rb-datatable-header">
                  <div class="col-sm-6">
                    <div class="dataTables_filter">
                      <div class="input-group input-search">
                        <input class="form-control" type="text" th:placeholder="${bundle.L('查询')}" maxlength="40" />
                        <span class="input-group-btn">
                          <button class="btn btn-secondary" type="button"><i class="icon zmdi zmdi-search"></i></button>
                        </span>
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-6">
                    <div class="dataTables_oper">
                      <button class="btn btn-primary J_new-field" type="button"><i class="icon zmdi zmdi-plus"></i> [[${bundle.L('添加')}]]</button>
                      <div class="btn-group bosskey-show">
                        <button class="btn btn-light w-auto dropdown-toggle ml-2" type="button" data-toggle="dropdown">[[${bundle.L('更多')}]] <i class="icon zmdi zmdi-more-vert"></i></button>
                        <div class="dropdown-menu dropdown-menu-right">
                          <a class="dropdown-item J_new2-field">[[${bundle.L('批量添加')}]]</a>
                          <a class="dropdown-item J_export-fields">[[${bundle.L('导出')}]] (CSV)</a>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="row rb-datatable-body">
                  <div class="col-sm-12">
                    <div class="rb-loading rb-loading-active data-list">
                      <table class="table table-hover table-striped tablesort" id="dataList">
                        <thead>
                          <tr>
                            <th width="25%" data-filed="fieldLabel">[[${bundle.L('字段名称')}]]</th>
                            <th width="16%" data-field="fieldName">[[${bundle.L('内部标识')}]]</th>
                            <th width="16%" data-field="displayType">[[${bundle.L('类型')}]]</th>
                            <th data-field="comments">[[${bundle.L('备注')}]]</th>
                            <th width="50" class="no-sort"></th>
                          </tr>
                        </thead>
                        <tbody></tbody>
                      </table>
                      <th:block th:replace="~{/_include/spinner}" />
                    </div>
                  </div>
                </div>
                <div id="pagination">
                  <div class="row rb-datatable-footer">
                    <div class="col-sm-3"><div class="dataTables_info"></div></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <th:block th:replace="~{/_include/footer}" />
    <script th:src="@{/assets/lib/jquery.tablesort.min.js}"></script>
    <script>
      window.__PageConfig = {
        entityName: '[[${entityName}]]',
        nameField: '[[${nameField}]]',
        isSuperAdmin: '[[${isSuperAdmin}]]' === 'true',
      }
    </script>
    <script th:src="@{/assets/js/metadata/entity-switch.js}" type="text/babel"></script>
    <script th:src="@{/assets/js/metadata/fields.js}" type="text/babel"></script>
  </body>
</html>
